import request from '@/config/axios'
/**
 * 新增营销模板
 */
export const create = (data) => {
  return request.post({ url: '/market/market-template/create', data })
}

/**
 * 更新营销模板
 */
export const update = (data) => {
  return request.put({ url: '/market/market-template/update', data })
}

/**
 * 删除营销模板
 */
export const deleted = (id) => {
  return request.delete({ url: '/market/market-template/deleted?id=' + id })
}

/**
 * 分页查询营销模板
 */
export const pageQuery = (params) => {
  return request.get({ url: '/market/market-template/page-query', params })
}

/**
 * 获取单个营销模板
 */
export const singleGet = (id) => {
  return request.get({ url: '/market/market-template/single-get?id=' + id })
}

/**
 * 查询营销模板
 */
export const simpleList = () => {
  return request.get({ url: '/market/market-template/simple-list' })
}

/**
 * 根据TemplateId获取正文
 */
export const getContentByTemplateId = (templateId) => {
  return request.get({
    url: '/market/market-template/get-content-by-template-id?templateId=' + templateId
  })
}

/**
 * 根据TemplateId获取资源
 */
export const getResourceByTemplateId = (templateId) => {
  return request.get({
    url: '/market/market-template/get-resource-by-template-id?templateId=' + templateId
  })
}
